<template>
  <div>
    <h1>子组件</h1>
    <h3>我有很多{{ toy }}</h3>
    <!-- <h3 v-else>我没有了{{ toy }}</h3> -->
    <h3 v-show="carSum>0">父亲给了我{{carSum}}辆车</h3>
    <button @click="sendFather(toy)">给父亲一个变形金刚</button>
    <!-- <button @click="naFather(toy)">拿回变形金刚</button> -->
  </div>
</template>

<script setup lang='ts' name="Child">
import { ref, reactive } from 'vue'



let toy = ref("变形金刚")

// let isShow = ref(false)
defineProps(['sendFather','naFather','carSum'])

</script>


<style lang='scss' scoped>

</style>